<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用 Math.max() 确定数组中最大的数</title>
</head>

<body>
    <h1>JavaScript 数组排序</h1>
    <p>最高值是：<span id="demo"></span></p>
    <script>
        var points = [40, 100, 1, 5, 25, 10];
        document.getElementById("demo").innerHTML = myArrayMax(points);

        function myArrayMax(arr) {
            return Math.max.apply(null, arr);
        }
    </script>
</body>

</html>